package com.fog.student.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fog.student.common.Base;
import com.fog.student.dto.CourseDto;
import com.fog.student.dto.SelectedCourseDto;
import com.fog.student.entity.SelectedCourse;
import com.fog.student.service.SelectedCourseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Slf4j
@RequestMapping("/selected")
public class SelectedCourseController {
    @Resource
    private SelectedCourseService selectedCourseService;

    @GetMapping("/page")
    public Base page(Integer page, Integer pageSize, String courseName,String beginTime,String endTime){
        Page<SelectedCourseDto> pageInfo = selectedCourseService.pageSearch(page,pageSize,courseName,beginTime,endTime);
        return Base.success(pageInfo);
    }

}
